<?php
use \yii\widgets\ActiveForm;
use app\modules\setting\models\yh\SetYhJbxx;
use yii\helpers\Html as H;
use app\common\helper\CommonHelper;
use app\modules\setting\models\yh\SetYhCcsj;

/**
 * @var $model SetYhJbxx
 * @var $ccsj SetYhCcsj
 */
$hide_option = [
    'template'=>'{input}',
    'options' => []
];
$ccsj = $model['ccsj'];
if(!($ccsj instanceof SetYhCcsj)){
    $ccsj = new SetYhCcsj();
    $ccsj->openid = $model->openid;
    $ccsj->name = $model->name ? $model->name:"";
    $ccsj->save();
}
?>
<div class="wrap">


    <div class="content">
        <div class="bg-box">

            <?php $form = ActiveForm::begin(['id' => 'login-form']);
            echo H::hiddenInput('openid',$model->openid,$hide_option);
            echo $form->field($model,'id',$hide_option)->hiddenInput();
            echo $form->field($model,'openid',$hide_option)->hiddenInput();
            echo $form->field($ccsj,'id',$hide_option)->hiddenInput();
            echo $form->field($ccsj,'openid',$hide_option)->hiddenInput();

            echo CommonHelper::rowDiv([
                $form->field($model,'name')->textInput(),
                $form->field($ccsj,'hbk')->textInput(),
                $form->field($ccsj,'sg')->textInput(),
                $form->field($ccsj,'qyj')->textInput(),
                $form->field($ccsj,'tz')->textInput(),
                $form->field($ccsj,'hyj')->textInput(),
                $form->field($ccsj,'zb')->textInput(),
                $form->field($ccsj,'tgd')->textInput(),
                $form->field($ccsj,'yc')->textInput(),
                $form->field($ccsj,'jq')->textInput(),
                $form->field($ccsj,'jk')->textInput(),
                $form->field($ccsj,'xf')->textInput(),
                $form->field($ccsj,'xw')->textInput(),
                $form->field($ccsj,'xc')->textInput(),
                $form->field($ccsj,'xxw')->textInput(),
                $form->field($ccsj,'xk')->textInput(),
                $form->field($ccsj,'yw')->textInput(),
                $form->field($ccsj,'ldw')->textInput(),
                $form->field($ccsj,'tw')->textInput(),
                $form->field($ccsj,'lzw')->textInput(),
                $form->field($ccsj,'xgd')->textInput(),
                $form->field($ccsj,'lg')->textInput(),
                $form->field($ccsj,'qxk')->textInput(),
            ],['class'=>'col-6']);
            echo H::tag('div',H::submitButton('提交',['class' => 'btn btn-primary btn-block', 'name' => 'login-button']),[
                'class'=>'form-group mt2 text-center'
            ]);
            ActiveForm::end(); ?>
        </div>
    </div>
</div>

